Skip to content

Conversation

@zaleslaw
Copy link
Collaborator

@zaleslaw zaleslaw commented Dec 1, 2025

Closes #1595

… deprecation of old constants""

This reverts commit 63ecf8a.
…Mode` enumeration and refine database handling""

This reverts commit 0037070.
Polished the `H2` compatibility `Mode` enum with improved formatting and readability. Addressed minor import reorganizations, streamlined `toDbType` and `fromDbType` methods, and fixed consistency in error messages. Updated tests and utilities accordingly.
@zaleslaw zaleslaw requested review from Copilot and koperagen December 1, 2025 18:28
Copilot finished reviewing on behalf of zaleslaw December 1, 2025 18:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors H2 database compatibility mode handling by introducing an enum-based approach to replace the previous dialect-based system. The changes enable better support for H2's Regular (native) mode and improve mode detection from both JDBC URLs and active connections.

Key changes:

  • Introduced H2.Mode enum to represent H2 compatibility modes (Regular, MySQL, PostgreSQL, MSSQLServer, MariaDB)
  • Refactored mode detection to query the active H2 connection's INFORMATION_SCHEMA.SETTINGS
  • Added comprehensive tests for all supported H2 modes and unsupported mode error handling

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
docs/StardustDocs/topics/dataSources/sql/H2.md Added documentation and code examples for H2 compatibility modes
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/H2.kt Introduced Mode enum, deprecated old constructor, refactored delegate handling for null mode
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/util.kt Extracted and refactored H2 mode parsing logic into helper functions, improved connection-based mode detection
dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/h2/h2Test.kt Added tests for all H2 compatibility modes and unsupported mode error cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@koperagen koperagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, please answer tiny question above and fix the build: apiDump and linter maybe

@zaleslaw zaleslaw merged commit 4ee79ed into master Dec 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

H2 database without dialect is unsupported

3 participants